package com.xqy.service;

import com.xqy.mapper.UserMapper;
import com.xqy.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class UserImpl implements UserService{
    @Autowired
    private UserMapper userMapper;
    public void addUser(User user) {
        userMapper.insert(user);
    }

    public User getUser(Integer userId) {
        return userMapper.selectByUserId(userId);
    }

    public List<User> getList() {
        return userMapper.queryList();
    }
}
